from public.tools import *
from public.action import *
from public.testDATE import *

from selenium.webdriver.common.keys import Keys

testCase="DBshop008_销售管理支付记录"
rootpath=get_pro_rootpath()
filepath=rootpath+r"\public\ZCdh.txt"
orderID=readFile(filepath)
# "1.点击销售管理支付记录。
firefox=openB(adminurl)
adminlogin(firefox)
menu2(firefox,"销售管理","支付记录")

# 2,点击""订单号""按钮，查看订单已发货还是未发货。"
s1=firefox.find_element_by_xpath("//td[a='%s']/following-sibling::td[2]"%orderID).text
print(s1)
firefox.find_element_by_xpath("//td/a[text()='%s']"%orderID).click()

#断言
a=firefox.find_element_by_xpath("//strong/span").text
if a=="订单完成"  :#is_displayed()函数判断元素是否显示
    writeLog("%s 测试通过"%testCase)
else:
    writeLog("%s 测试失败" % testCase)
    getPhoto(firefox)
# if yuqi1==aa or yuqi2==aa or yuqi3==aa :
#     writeLog("%s 测试通过" % testCase)
# else:
#     writeLog("%s 测试失败" % testCase)
#     getPhoto(firefox)
firefox.quit()